<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>编辑等级</title>
 
<link href="${ctx}/resources/media/css/chosen.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${ctx}/resources/media/css/bootstrap-wysihtml5.css" />
<link rel="stylesheet" type="text/css"
	href="${ctx}/resources/media/css/select2_metro.css" />
<script type="text/javascript"
	src="${ctx}/resources/media/js/bootstrap-fileupload.js"></script>
<script type="text/javascript"
	src="${ctx}/resources/media/js/chosen.jquery.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="${ctx}/resources/media/css/datetimepicker.css" />
<link rel="stylesheet" href="${ctx}/resources/media/css/dialog.css" />
<link rel="stylesheet" type="text/css"
	href="${ctx}/resources/media/css/bootstrap-fileupload.css" />
<script type="text/javascript"
	src="${ctx}/resources/media/js/bootstrap-fileupload.js"></script>
<link href="${ctx}/resources/media/css/jquery.fancybox.css"
	rel="stylesheet" />

<link href="${ctx}/resources/media/css/chosen.css" rel="stylesheet"
	type="text/css" />

<link rel="shortcut icon"
	href="${ctx}/resources/media/image/favicon.ico" />
</head>
<body>
	<div class="row-fluid profile">
		<div class="span12">
			<!--BEGIN TABS-->
			<div class="tabbable tabbable-custom tabbable-full-width">
				<ul class="nav nav-tabs">
					<li><a href="${ctx}/investcrowd/limit">众筹列表</a></li>		
					<li><a href="${ctx}/investcrowd/limit/add">添加众筹</a></li>	
					<li><a href="${ctx}/investcrowd/limit/level/${id}">等级列表</a></li>
					<li class="active"><a href="#">添加等级</a></li>
				</ul>
				<div class="tab-content">
					<!--end tab-pane-->
					<div class="tab-pane profile-classic row-fluid active" id="tab_1_2">
						<div class="span12">
							<!-- BEGIN SAMPLE FORM PORTLET-->
							<div class="portlet box blue">
								<div class="portlet-title">
									<div class="caption">
										<i class="icon-reorder"></i> <span class="hidden-480">编辑等级</span>
									</div>
								</div>
								<!-- END SAMPLE FORM PORTLET-->
								<div class="portlet-body form ">
									<form class="form-horizontal" id="form"
										action="${ctx}/investcrowd/limit/saveControl" method="post"
										enctype="multipart/form-data">
										<fieldset>
												<input id="limitId" type="hidden" name="limitId"
												value="${id }">
												<input id="id" type="hidden" name="id"
												value="${investCrowdControl.id }">
												<input id="version" type="hidden" name="version"
												value="${investCrowdControl.version }">
											<h4 class="form-section">添加众筹</h4>
											<div class="row-fluid">
												<div class="span6">
													<div class="control-group">

														<label class="control-label">众筹名称</label>
														<div class="controls">
															<input type="text" id="crowdName" name="crowdName"
																class="m-wrap input-xlarge" value="${investCrowdControl.crowdName }" maxlength="30">
															<span class="help-inline"></span>
														</div>
													</div>
												</div>
												<div class="span6">
													<div class="control-group">

														<label class="control-label">众筹阶段</label>
														<div class="controls">
															<input type="text" name="level" id="level"
																class="m-wrap input-xlarge" value="${level }" maxlength="10" readonly="readonly">
																<span class="help-inline"></span>
														</div>
													</div>
												</div>
											</div>
											<div class="row-fluid">
												<div class="span6">
													<div class="control-group">

														<label class="control-label">每份回报数量</label>
														<div class="controls">
															<input type="text" id="levelUnit" name="levelUnit"
																class="m-wrap input-xlarge" value="${investCrowdControl.levelUnit }" maxlength="10">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
												<c:if test="${amountControlMethod==1}">
												<div class="span6">
													<div class="control-group">

														<label class="control-label">分阶段可购买份数</label>
														<div class="controls">
															<input type="text" id="levelLimit" name="levelLimit"
																class="m-wrap input-xlarge" value="${investCrowdControl.levelLimit }" maxlength="10" onchange="onChangeLevelLimit()">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
												</c:if>
											</div>
											<c:if test="${amountControlMethod==1}">
											<div class="row-fluid">
												<div class="span6">
													<div class="control-group">

														<label class="control-label">分阶段剩余份数</label>
														<div class="controls">
															<input type="text" id="levelBalance" name="levelBalance"
																class="m-wrap input-xlarge" value="${investCrowdControl.levelBalance }" maxlength="10" readonly="readonly">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
												<div class="span6">
													<div class="control-group">

														<label class="control-label">购买数量</label>
														<div class="controls">
															<input type="text" id="levelCount" name="levelCount"
																class="m-wrap input-xlarge" value="0" maxlength="10" readonly="readonly">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											<div class="row-fluid">
												<div class="span6">
													<div class="control-group">

														<label class="control-label">回报项目</label>
														<div class="controls">
															<input type="text" id="returnPlan" name="returnPlan"
																class="m-wrap input-xlarge" value="${investCrowdControl.returnPlan }" maxlength="20">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
												<div class="span6">
													<div class="control-group">

														<label class="control-label">投资金额</label>
														<div class="controls">
															<input type="text" id="initialAmount" name="initialAmount"
																class="m-wrap input-xlarge" value="${investCrowdControl.initialAmount }" maxlength="10">
															<p class="help-block"></p>
														</div>
													</div>
												</div>
											</div>
											<div class="row-fluid">
												<div class="control-group">

													<label class="control-label" for="input01">等级描述</label>
													<div class="controls">
														<textarea class="wysihtml5 m-wrap" style="width: 1100px"
															name="levelDescription" id="levelDescription" rows="6" maxlength="2000">${investCrowdControl.levelDescription }</textarea>
														<p class="help-block"></p>
													</div>
												</div>
											</div>
										</fieldset>
										<div class="form-actions">
											<button type="submit" class="btn blue ibtsubmit">
												<i class="icon-ok"></i> 保存
											</button>
											<button type="button" onclick="history.go(-1)" class="btn">取消</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!--END TABS-->
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/jquery.dataTables.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/DT_bootstrap.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/select2.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/wysihtml5-0.3.0.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/bootstrap-wysihtml5.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/bootstrap-datetimepicker.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/jquery.validate.min.js"></script>
	<script src="${ctx}/resources/media/js/jquery.fancybox.pack.js"></script>
	<script src="${ctx}/resources/media/js/form-crowdLimit-validate.js"></script>
	<script type="text/javascript"
		src="${ctx}/resources/media/js/chosen.jquery.min.js"></script>
	<script src="${ctx}/resources/media/js/app.js"></script>

	<script src="${ctx}/resources/media/js/gallery.js"></script>
	<script type="text/javascript">
		var dt;
		var count = 1;
		$(function() {
			$("select").select2();
			
			
			FormAdvertValidate.init();
			Gallery.init();
			//FormFileUpload.init('${ctx}');

			if ($('.wysihtml5').size() > 0) {
				$('.wysihtml5').wysihtml5({});
			}

		});

		function onChangeLevelLimit() {
			$("#levelBalance").val($("#levelLimit").val());
		}
		
		$(".form_meridian_datetime").datetimepicker({
			format : "yyyy-m-d h:i",
			//showMeridian: true,
			language : "zh",
			autoclose : true,
			pickerPosition : (App.isRTL() ? "bottom-right" : "bottom-left"),
			todayBtn : true
		});

	</script>


</body>
</html>